package tum0r.model;

import tum0r.util.Hash;
import tum0r.util.StringUtils;

import java.security.NoSuchAlgorithmException;
import java.util.UUID;

/**
 * 工程: ResourcesDatabase<br>
 * 包: tum0r.model<br>
 * 创建者: tum0r<br>
 * 创建时间: 2020/10/4 17:17<br>
 * <br>
 */
public class ResourceContent {
    public String ID;
    public int Index;
    public String Fingerprint;
    public byte[] Content;

    public void setNewID() {
        this.ID = UUID.randomUUID().toString().replace("-", "");
    }

    public void setContent(byte[] content) {
        Content = content;
    }

    public void setFingerprint() {
        try {
            Fingerprint = new Hash().encryption(Content);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
    }
}
